package com.xiaoma.chat.webservice;

import java.util.HashMap;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.dexcoder.assistant.persistence.JdbcDao;
import com.xiaoma.chat.domain.SyncMessageRecord;
import com.xiaoma.chat.service.GroupService;
import com.xiaoma.chat.service.HistoryService;

@Controller
@RequestMapping("/test")
public class TestController {

    private Logger LOG = LoggerFactory.getLogger(TestController.class);
    @Autowired
    private HistoryService historyService;
    @Autowired
    private GroupService groupService;
    
    @Autowired
    private JdbcDao jdbcDao;
    
    @RequestMapping(value="/1", method = RequestMethod.GET)
    @ResponseBody
    public Map<String, Object> test() {
        Map<String, Object> result = new HashMap<String, Object>();
        SyncMessageRecord  syncMessageRecord = historyService.getLastRecord();
        System.out.println(syncMessageRecord);
        result.put("syncMessageRecord", syncMessageRecord);
        return result;
        
    }
    
}
